package com.lb.shopguide.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lb.shopguide.R;
import com.lb.shopguide.entity.shop.StoreBean;
import com.lb.shopguide.util.pic.ImageLoaderUtils;

import java.util.List;

/**
 * Created by kang on 2018/1/2.
 */

public class AdapterStore extends BaseQuickAdapter<StoreBean, BaseViewHolder> {
    public AdapterStore(int layoutResId, @Nullable List<StoreBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, StoreBean item) {
        View view = helper.itemView;
        ImageView ivShopLogo = view.findViewById(R.id.iv_shop_logo);
        TextView tvShopName = view.findViewById(R.id.tv_shop_name);
        TextView tvShopPhone = view.findViewById(R.id.tv_shop_phone);
        TextView tvShopAddr = view.findViewById(R.id.tv_shop_addr);

        tvShopName.setText(item.getStoreName());
        tvShopPhone.setText(item.getMobileNum());
        tvShopAddr.setText(item.getConnectAddress());
        ImageLoaderUtils.getGlideManager().asBitmap().load(item.getStoreLogoUrl()).apply(ImageLoaderUtils.getSGCommonGlideOption(12)).into(ivShopLogo);
    }
}
